@import org.silkframework.workspace.User
@import org.silkframework.dataset.Dataset
@import org.silkframework.rule.TransformSpec

@(project: String, modifier: String, inputId: Option[String])

@datasets = @{ User().workspace.project(project).tasks[Dataset] }
@transformTasks = @{ User().workspace.project(project).tasks[TransformSpec] }

<div class="mdl-selectfield mdl-js-selectfield mdl-selectfield--floating-label">
  <select class="mdl-selectfield__select" id="@{modifier}_dataset" name="@{modifier}_dataset">
    <option value=""></option>
    @for(dataset <- datasets) {
      @if(inputId.isDefined && dataset.id == inputId.get) {
        <option value="@dataset.id" selected="selected">@dataset.id</option>
      } else {
        <option value="@dataset.id">@dataset.id</option>
      }
    }
    @for(transform <- transformTasks) {
      @if(inputId.isDefined && transform.id == inputId.get) {
        <option value="@transform.id" selected="selected">@transform.id</option>
      } else {
        <option value="@transform.id">@transform.id</option>
      }
    }
  </select>
  <label class="mdl-selectfield__label" for="@{modifier}_dataset">@{modifier.capitalize} Dataset</label>
  <div class="mdl-tooltip mdl-tooltip--right" for="@{modifier}_dataset">
    The @modifier dataset.
  </div>
</div>
